package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_advert_resource;

//DAO
public interface U_advert_resourceMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_ADVERT_RESOURCE  WHERE ID = #{id}")
	public ApiU_advert_resource findU_advert_resourceById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_advert_resource")
	public List<ApiU_advert_resource> findU_advert_resources();

	// 添加
	@Insert("INSERT INTO U_ADVERT_RESOURCE (RESOURCE_URL, H5_URL, SORT, NAME, ADVERT_ID) VALUES (#{resource_url}, #{h5_url}, #{sort}, #{name}, #{advert_id})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_advert_resource(ApiU_advert_resource u_advert_resource);

	// 修改
	@Update("UPDATE U_ADVERT_RESOURCE SET RESOURCE_URL = #{resource_url}, H5_URL = #{h5_url}, SORT = #{sort}, NAME = #{name}, ADVERT_ID = #{advert_id} WHERE ID = #{id}")
	public int updateU_advert_resource(ApiU_advert_resource u_advert_resource);

	// 删除
	@Delete("DELETE FROM U_ADVERT_RESOURCE  WHERE ID = #{id}")
	public int deleteU_advert_resource(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
